home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 June / Cd Pc Users 9.iso / prog / inst / anictl / resource.txt < prev   
Encoding:
Text File  |  1998-04-12  |  3.3 KB  |  77 lines

  1.        VB Common Controls Replacement Project - Animation Control
  2.         Notes on using this control to load AVI Resources
  3.  
  4. Using this control it is possible to display an AVI included as a resource 
  5. within the compiled EXE and such that it is not necessary to distribute the 
  6. original AVI files with the application.
  7.  
  8. This file provides a brief overview of the ins and outs of including AVI 
  9. resource in your application and a catches you should be aware of:
  10.  
  11. The catch is that the control is not able to display an AVI resource whilst 
  12. the program is being run within the IDE. Therefore, you must compile the 
  13. application to an EXE and run the EXE to correctly load and play an AVI 
  14. Resource.
  15.  
  16. The first step to including an AVI resource into your application is to 
  17. create a resource template (.RC) file containing something like this:
  18.  
  19. 1  AVI  DISCARDABLE     filecopy.avi
  20.  
  21. The first number is the unique identifier of the resource. The resource 
  22. must be of type AVI or else the control will not load the resource. 
  23. Finally, you should specify that the resource is discardable and then give 
  24. the name of the file that you wish to include as a resource.
  25.  
  26. Once you have created this file, you need to use a resource compiler to 
  27. create a .RES file (Microsoft supply a resource compiler with most of their 
  28. development products called RC.EXE).
  29.  
  30. Once you have created the .RES file, go to your project in VB5, select 
  31. Project, Add File... and select the .RES file you have just created. The 
  32. .RES file will be added under related documents and will be compiled into 
  33. the EXE when you build your project.
  34.  
  35. To display the AVI resource, place a ccrpAnimation control on a form and in 
  36. the appropriate section of the code, add the line:
  37.  
  38. ccrpAnimation.OpenAVIResource 1, App.hInstance
  39.  
  40. replacing 1 by the unique identifier of the resource as defined in the RC 
  41. file. You must pass App.hInstance as the last parameter or the control will 
  42. not be able to locate the resource. If you set AutoPlay to true for the
  43. control then the AVI will start playing once this line is executed. If not, 
  44. you will need to call the Play method to start the AVI playing.
  45.  
  46. This is all that is required to include an AVI resource into your 
  47. application and play it. If you are a registered owner of VB5, you can 
  48. simplify the management of resource files within the IDE by downloading the 
  49. VB Resource Editor add-in from the Visual Basic owner's site (link from 
  50. http://www.microsoft.com/vbasic).
  51.  
  52. An example project demonstrating the use of AVI resources can be found in 
  53. RESDEMO.ZIP included with this file.
  54.  
  55. If you intend to use standard resources as used by Windows Explorer such as 
  56. the File Copy animation or Find File animation, they can be loaded directly
  57. by the control simply by calling the OpenStandardAVIResource method. 
  58. Currently this method can load the resources equivalent to the following files
  59. provided with VB5:
  60.  
  61. Find Folder        SEARCH.AVI
  62. Find File        FINDFILE.AVI
  63. Find Computer        FINDCOMP.AVI
  64. File Copy        (Similar to FILECOPY.AVI)
  65. File Move        FILEMOVE.AVI
  66. Delete to Recycle Bin    FILEDEL.AVI
  67. Empty Recycle Bin    FILENUKE.AVI
  68. File Delete        FILEDELR.AVI
  69.  
  70. If you have any questions about the animation control, email me at 
  71. jeremyadams@hotmail.com
  72.  
  73. Enjoy!
  74.  
  75. Jeremy Adams
  76. jeremyadams@hotmail.com
  77. CCRP: http://www.mvps.org/ccrp.